package cc.comac.mom.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import cc.comac.mom.api.QualityRejectService;
import cc.comac.mom.bean.QualityReject;
import cc.comac.mom.bean.base.LimitPageBean;
import cc.comac.mom.datahandlers.entity.QualityRejectDataHandler;
import cc.comac.mom.entity.QualityRejectEntity;
import cc.comac.mom.util.ResultBean;

@Service
@RestController
public class QualityRejectServiceImpl implements QualityRejectService {
	@Autowired
	private QualityRejectDataHandler qualityRejectDataHandler;

	@Override
	public ResultBean insert(@RequestBody QualityReject obj) {
		// TODO Auto-generated method stub
		return qualityRejectDataHandler.insert(obj);
	}

	@Override
	public ResultBean insertBatch(@RequestBody List<QualityReject> list) {
		// TODO Auto-generated method stub
		return qualityRejectDataHandler.insertBatch(list);
	}

	@Override
	public ResultBean deleteBatch(@RequestBody List<QualityReject> list) {
		// TODO Auto-generated method stub
		return qualityRejectDataHandler.deleteBatch(list);
	}

	@Override
	public ResultBean selectByCondition(@RequestBody QualityReject obj) {	
		ResultBean resultBean = new ResultBean(true);
		LimitPageBean<QualityRejectEntity> limitPageBean = qualityRejectDataHandler.selectByCondition(obj);
		resultBean.setObject(limitPageBean);	
		return resultBean;
	}

}
